const Mock = require('mockjs');
const util = require('./util');

module.exports = function (app) {
  //用户列表
  app.get('/user/userList', function (rep, res) {
    var json = util.getJsonFile('./api/userlist.json');
    res.json(Mock.mock(json));
  });
  //增加用户
  app.post('/user/addUserInfo', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //编辑用户
  app.post('/user/userUpdate', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //重置用户密码
  app.post('/user/resetUserPassword', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //员工管理下拉选择
  app.get('/user/addContent', function (rep, res) {
    var json = util.getJsonFile('./api/addContent.json');
    res.json(Mock.mock(json));
  });
  //员工详情
  app.get('/user/userDetail', function (rep, res) {
    var json = util.getJsonFile('./api/userDetail.json');
    res.json(Mock.mock(json));
  });
  //组长列表
  app.get('/audit/auditList', function (rep, res) {
    var json = util.getJsonFile('./api/auditList.json');
    res.json(Mock.mock(json));
  });
  //删除组长
  app.post('/audit/groupLeader/delete', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //更改组长
  app.post('/audit/groupLeader/change', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //获取组员列表
  app.get('/audit/crewList', function (rep, res) {
    var json = util.getJsonFile('./api/crewList.json');
    res.json(Mock.mock(json));
  });
  //获取物料列表
  app.get('/material/materialList', function (rep, res) {
    var json = util.getJsonFile('./api/materialList.json');
    res.json(Mock.mock(json));
  });
  //新增物料
  app.post('/material/addMaterial', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //修改物料
  app.post('/material/updateMaterial', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //物料下拉
  app.get('/material/addContent', function (rep, res) {
    var json = util.getJsonFile('./api/materialCntent.json');
    res.json(Mock.mock(json));
  });
  //成本中心列表
  app.get('/costCenter/list', function (rep, res) {
    var json = util.getJsonFile('./api/costList.json');
    res.json(Mock.mock(json));
  });
  //成本中心添加
  app.post('/costCenter/addCostCenter', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //成本中心编辑
  app.post('/costCenter/updateAssociateBrand', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //获取品牌成本中心列表
  app.get('/costCenter/associateBrandList', function (rep, res) {
    var json = util.getJsonFile('./api/associateBrandList.json');
    res.json(Mock.mock(json));
  });
  //获取品牌列表
  app.get('/brand/brandList', function (rep, res) {
    var json = util.getJsonFile('./api/brandBrandList.json');
    res.json(Mock.mock(json));
  });
  //获取品牌类目
  app.get('/brand/classList', function (rep, res) {
    var json = util.getJsonFile('./api/brandClassList.json');
    res.json(Mock.mock(json));
  });
  //修改品牌
  app.post('/brand/updateBrand', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //添加品牌
  app.post('/brand/addBrand', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //获取添加任务下来内容
  app.get('/task/taskAddContent', function (rep, res) {
    var json = util.getJsonFile('./api/taskAddContent.json');
    res.json(Mock.mock(json));
  });
  //任务审批进度
  app.get('/task/approvalProgress', function (rep, res) {
    var json = util.getJsonFile('./api/approvalProgress.json');
    res.json(Mock.mock(json));
  });
  //我的审批
  app.get('/task/myApproval', function (rep, res) {
    var json = util.getJsonFile('./api/myApproval.json');
    res.json(Mock.mock(json));
  });
  //添加任务
  app.post('/task/addTask', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //获取任务历史下拉内容
  app.get('/task/taskHistoryContent', function (rep, res) {
    var json = util.getJsonFile('./api/taskHistoryContent.json');
    res.json(Mock.mock(json));
  });
  //获取任务历史
  app.get('/task/taskHistory', function (rep, res) {
    var json = util.getJsonFile('./api/taskHistory.json');
    res.json(Mock.mock(json));
  });
  //修改任务
  app.post('/task/updateMyTask', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //删除任务
  app.post('/task/deleteTask', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
  //获取用户品牌常用列表
  app.get('/task/brandCommonList', function (rep, res) {
    var json = util.getJsonFile('./api/brandCommonList.json');
    res.json(Mock.mock(json));
  });
  //审核任务
  app.post('/task/taskAudit', function (rep, res) {
    var json = util.getJsonFile('./api/success.json');
    res.json(Mock.mock(json));
  });
}